package com.ydd.userserver.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ydd.common.utils.RedisUtil;
import com.ydd.userserver.entity.UserEntity;
import com.ydd.userserver.mapper.UserMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.catalina.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.concurrent.TimeUnit;

@Service
@Slf4j
public class BaseService {

    @Autowired
    private RedisUtil redisUtil;

    @Autowired
    private UserMapper userMapper;
    public String  testRedis() {
        redisUtil.set("key1","val1",1l, TimeUnit.DAYS);
       return redisUtil.get("key1");
    }

    public UserEntity testMysql() {
        UserEntity a = userMapper.selectById(1);
        return a;
    }
}
